home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ccdl150l.zip
/
IO
/
FGETPOS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-26
|
414b
|
21 lines
#include <stdio.h>
#include <time.h>
#include <libp.h>
int fgetpos(FILE *stream, fpos_t *curpos)
{
if (stream->token == FILTOK) {
*curpos = _ll_getpos(stream->fd);
if (*curpos < 0) {
stream->flags |= _F_ERR;
return EOF;
}
if (stream->flags & _F_IN)
*curpos -= stream->level;
else
if (stream->flags & _F_OUT)
*curpos += stream->level;
return 0;
}
return EOF;
}